﻿#define  _CRT_SECURE_NO_WARNINGS 1
#include "game.h"


void menu(void)
{
	printf("*********************\n");
	printf("*****  0.退出  ******\n");
	printf("*****  1.启动  ******\n");
	printf("*********************\n");
}

void game(void)
{
	//创建棋盘
	char show[ROWS][COLS];
	char mine[ROWS][COLS];
	//初始化棋盘//show数组展示*//mine先为0；到时候再埋雷‘1’
	InitBroad(mine, ROWS, COLS, '0');
	InitBroad(show, ROWS, COLS, '*');
	//打印棋盘
	Display_Broad(show, ROW, COL);
	/*Display_Broad(mine, ROW, COL);*/
	//埋雷//随机的坐标rand
	Set_mine(mine, ROW, COL);
	Display_Broad(mine, ROW, COL);
	//排查雷
	Find_Mine(mine,show,ROW,COL);

}

int main()
{
	int input = 0;
	do {
		srand((unsigned int)time(NULL));
		menu();
		scanf("%d", &input);
		switch (input)
		{
		case EXIT:
			printf("退出游戏\n");
			break;
		case PLAY:
			printf("开始游戏\n");
			game();
			break;
		default:
			break;
		}
	} while (input);

	return 0;
}